$(function() {
    var galleries = $('.ad-gallery').adGallery();

    $('#switch-effect').change(
	function() {
	    galleries[0].settings.effect = $(this).val();
	    return false;
	}
    );
    $('#toggle-slideshow').click(
	function() {
	    galleries[0].slideshow.toggle();
	    return false;
	}
    );
    $('#toggle-description').click(
	function() {
	    if(!galleries[0].settings.description_wrapper) {
		galleries[0].settings.description_wrapper = $('#descriptions');
	    } else {
		galleries[0].settings.description_wrapper = false;
	    }
	    return false;
	}
    );
});